package com.xnf.behavior.controller.v1;

import com.xnf.api.behavior.ApBehaviorEntryControllerApi;
import com.xnf.behavior.service.ApBehaviorEntryService;
import com.xnf.model.behavior.pojos.ApBehaviorEntry;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Created by xnf on 2022/3/8.
 */
@RestController
@RequestMapping("/api/v1")
public class ApBehaviorEntryController implements ApBehaviorEntryControllerApi {

    @Autowired
    private ApBehaviorEntryService apBehaviorEntryService;

    @Override
    @GetMapping("/behavior_entry/one")
    public ApBehaviorEntry findByUserIdOrEntryId(@RequestParam(value = "userId",required = false) Integer userId,
                                                 @RequestParam(value = "equipmentId",required = false) Long equipmentId) {
        return apBehaviorEntryService.findByUserIdOrEquipmentId(userId,equipmentId);
    }
}
